<!doctype html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>经济文明App-首页</title>
    <link href="./static/css/bootstrap.min.css" rel="stylesheet">
    <link href="./static/icons/bootstrap-icons.css" rel="stylesheet">
    <link rel="shortcut icon" href="./static/img/favicon.ico" type="image/x-icon">
    <style>
        .des-text {
            font-size: medium;
        }

        .title-text {
            font-size: medium;
        }
    </style>
</head>

<body>
    <nav class="navbar navbar-expand-lg bg-light">
        <div class="container-fluid">
            <a class="navbar-brand" data-bs-toggle="modal" data-bs-target="#staticBackdrop" href="#">欢迎使用经济文明APP</a>

            <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page" href="register.html">注册</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">关于我们</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="https://team.2020cn.cn">诚聘英才</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link disabled">退出</a>
                    </li>
                </ul>
                <form class="d-flex" role="search">
                    <input class="form-control me-2" type="search" placeholder="搜索" aria-label="Search">
                    <button class="btn btn-outline-success text-nowrap" type="submit">搜索</button>
                </form>
            </div>
        </div>
    </nav>
    <!-- Button trigger modal -->

    <!-- Modal -->
    <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
        aria-labelledby="staticBackdropLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="staticBackdropLabel">公告标题</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    人民胜利了人民胜利了人民胜利了人民胜利了人民胜利了人民胜利了人民胜利了人民胜利了人民胜利了
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" data-bs-dismiss="modal">我知道了</button>
                </div>
            </div>
        </div>
    </div>
    <div class="container ">
        <!-- <div class="alert alert-warning alert-dismissible fade show" role="alert">
            <strong>首页全局通知</strong> 这是全局通知，您可以关闭它！下次打开还会显示！
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
        </div> -->
        <!-- s toast -->
        <!-- <button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button> -->

        <div class="toast-container  position-fixed bottom-0 end-0 p-3 ">
            <div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
                <div class="toast-header">

                    <strong class="me-auto">提示</strong>
                    <small>点击关闭</small>
                    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
                </div>
                <div class="toast-body">
                    这是一条提示信息
                </div>
            </div>
        </div>
        <!-- e toast -->
        <!-- s center btns -->

        <div class="row row-cols-3 row-cols-md-5 g-1 ">
            <div class="col ">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardDesktop"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-window-desktop" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">添加桌面</h5>
                        <p class="card-subtitle des-text">从我做起自己做主创造未来</p>
                    </div>
                </div>

            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardCore"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-circle" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">宗旨</h5>
                        <p class="card-subtitle des-text">平台文化浏览</p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardVote"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-flag" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">投票</h5>
                        <p class="card-subtitle des-text">民主投票平台重大事项</p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardChat"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-chat" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">聊天</h5>
                        <p class="card-subtitle des-text">逐步发展平台自己聊天软件</p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardMy" onclick="goto(id)"
                    style="width: 6rem;">
                    <i class="bi bi-person-square" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">个人中心</h5>
                        <p class="card-subtitle des-text"></p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardSale"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-coin" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">拍卖</h5>
                        <p class="card-subtitle des-text">游戏签到等积分可拍卖现金</p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardGame"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-controller" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">游戏</h5>
                        <p class="card-subtitle des-text">游戏可获得金币</p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardRank"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-list-ol" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">排行</h5>
                        <p class="card-subtitle des-text">贡献排行榜</p>
                    </div>
                </div>
            </div>
            <div class="col">
                <div class="card border-3 border-primary w-100 h-100 text-center mx-auto" id="cardMsg"
                    onclick="goto(id)" style="width: 6rem;">
                    <i class="bi bi-send" style="font-size: 2rem; color: cornflowerblue;"></i>
                    <div class="card-body p-2">
                        <h5 class="card-title title-text">留言</h5>
                        <p class="card-subtitle des-text">留言建议讨论</p>
                    </div>
                </div>
            </div>

        </div>
        <!-- e center btns -->
        <div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="false">
            <div class="carousel-indicators">
                <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active"
                    aria-current="true" aria-label="Slide 1"></button>
                <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1"
                    aria-label="Slide 2"></button>
                <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2"
                    aria-label="Slide 3"></button>
            </div>
            <div class="carousel-inner">
                <div class="carousel-item active">
                    <img src="./static/img/blog1.jpg" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>宣传图1</h5>
                        <p>宣传图1的一些描述信息</p>
                    </div>
                </div>
                <div class="carousel-item">
                    <img src="./static/img/blog2.jpg" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>宣传图2</h5>
                        <p>宣传图2的一些描述信息</p>
                    </div>
                </div>
                <div class="carousel-item">
                    <img src="./static/img/blog3.jpg" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>宣传图3</h5>
                        <p>宣传图3的一些描述信息</p>
                    </div>
                </div>
            </div>
            <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions"
                data-bs-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="visually-hidden">Previous</span>
            </button>
            <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions"
                data-bs-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="visually-hidden">Next</span>
            </button>
        </div>


        <script src="./static/js/bootstrap.min.js"></script>
        <script src="./static/js/jquery-3.6.0.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                console.log("welcome:" + localStorage.getItem("user"))


                const toastTrigger = document.getElementById('liveToastBtn')
                const toastLiveExample = document.getElementById('liveToast')
                if (toastTrigger) {
                    toastTrigger.addEventListener('click', () => {
                        const toast = new bootstrap.Toast(toastLiveExample)

                        toast.show()
                    })
                }

            });
            function logout() {
                window.localStorage.removeItem("user");
                window.location.href = "./login.html";
            }

            function goto(id) {
                switch (id) {
                    case "cardChat":
                        window.location.href = "https://chat.2020cn.cn";
                        break;
                    case "cardCore":
                        window.location.href = "https://2020cn.cn/backend";
                        break;
                    case "cardGame":
                        window.location.href = "https://2020cn.cn/remake_sgjm_web/html_version/";
                        break;
                    case "cardMail":
                        window.location.href = "https://box.newciviliz.me/mail";
                        break;
                    case "cardMy":
                        //检查是否登录
                        var user = localStorage.getItem("user");
                        if (user == null) {
                            var ret = confirm("您未登录，是否前往登录页?");
                            if (ret == true) {
                                window.location.href = "https://2020cn.cn/login.html";
                            }
                        } else {
                            window.location.href = "https://2020cn.cn/my.html";
                        }
                        break;
                    default:
                        break;
                }
            }


        </script>
</body>

</html>